【curl】 Linux上用curl 查看请求头和响应头 您所在的位置:网站首页 curl -sl 【curl】 Linux上用curl 查看请求头和响应头

【curl】 Linux上用curl 查看请求头和响应头

2023-04-16 10:52| 来源: 网络整理| 查看: 265

curl,全称CommandLine URL 或 CommandLine Uniform Resource Locator,顾名思义,curl命令是在命令行方式下工作,利用URL的语法进行数据的传输或者文件的传输。

curl是基于URL语法在命令行方式下工作的文件传输工具,它支持FTP,FTPS,HTTP,HTTPS,GOPHER,TELNET,DICT,FILE及LDAP等协议。curl支持HTTPS认证,并且支持HTTP的POST,PUT等方法,FTP上传,kerberos认证,HTTP上传,代理服务器,cookies,用户名/密码认证,通过http代理服务器上传文件到FTP服务器等等,功能十分强大。

# curl --help

# curl  https://www.baidu.com

返回 response body

# curl  -v  https://www.baidu.com

返回 request header   request body   response header   response body

#  curl -i  https://www.baidu.com

返回response header 和 response body

# curl -I www.baidu.com

返回 response header

# curl -s -D -  https://www.baidu.com  -o /dev/null

测试网页返回值,在脚本中,这是很常见的测试网站是否正常的用法。

# curl -o /dev/null  -s  -w  %{http_code}  www.linux.com

#  wget --help

# wget   https://www.baidu.com   --debug

# wget  www.baidu.com  -S

Linux curl命令详解

https://www.cnblogs.com/duhuo/p/5695256.html

https://codeday.me/bug/20170221/3829.html

TCP/UDP常见端口参考

http://tools.jb51.net/table/tcp_udp_port

HTTP响应头和请求头信息对照表

http://tools.jb51.net/table/http_header

HTTP状态码对照表

http://tools.jb51.net/table/http_status_code

HTTP Content-type 对照表

http://tools.jb51.net/table/http_content_type



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有